package com.apbetioli.mapr.client;

/**
 *
 * @author alexandre.betioli
 */
public class Comunicator {

    public static String enviarXMLParaGerenciadorDeProjetos(String xml) {
       
        try {
            com.apbetioli.mapr.client.wsprojects.WSProjectsService service = new com.apbetioli.mapr.client.wsprojects.WSProjectsService();
            com.apbetioli.mapr.client.wsprojects.WSProjects port = service.getWSProjectsPort();
            
            return port.process(xml);
            
        } catch (Exception ex) {
            return ex.toString();
        }

    }
    
    public static String enviarXMLParaGerenciadorDeLocais(String xml, String projectKey) {
        
        try {
            com.apbetioli.mapr.client.wsplaces.WSPlacesService service = new com.apbetioli.mapr.client.wsplaces.WSPlacesService();
            com.apbetioli.mapr.client.wsplaces.WSPlaces port = service.getWSPlacesPort();

            return port.process(xml, projectKey);
           
        } catch (Exception ex) {
            return ex.toString();
        }

    }
}
